using System;
using System.Windows.Forms;

public class AddUser : System.Windows.Forms.Form
{

	#region " Windows Form Designer generated code "

	public AddUser() : base()
	{

		//This call is required by the Windows Form Designer.
		InitializeComponent();

		//Add any initialization after the InitializeComponent() call

	}

	//Form overrides dispose to clean up the component list.
	protected override void Dispose(bool disposing)
	{
		if (disposing)
		{
			if ((components != null))
			{
				components.Dispose();
			}
		}
		base.Dispose(disposing);
	}

	//Required by the Windows Form Designer
	private System.ComponentModel.IContainer components;

	//NOTE: The following procedure is required by the Windows Form Designer
	//It can be modified using the Windows Form Designer.  
	//Do not modify it using the code editor.
	internal System.Windows.Forms.Button btnOK;
	internal System.Windows.Forms.Button btnCancel;
	internal System.Windows.Forms.Label lblName;
	internal System.Windows.Forms.Label lblAddress;
	internal System.Windows.Forms.TextBox txtName;
	internal System.Windows.Forms.TextBox txtAddress;
	internal System.Windows.Forms.ErrorProvider ErrorProvider1;
	[System.Diagnostics.DebuggerStepThrough()]
	private void InitializeComponent()
	{
		this.lblName = new System.Windows.Forms.Label();
		this.lblAddress = new System.Windows.Forms.Label();
		this.txtName = new System.Windows.Forms.TextBox();
		this.txtAddress = new System.Windows.Forms.TextBox();
		this.btnOK = new System.Windows.Forms.Button();
		this.btnCancel = new System.Windows.Forms.Button();
		this.ErrorProvider1 = new System.Windows.Forms.ErrorProvider();
		this.SuspendLayout();
		//
		//lblName
		//
		this.lblName.Location = new System.Drawing.Point(16, 16);
		this.lblName.Name = "lblName";
		this.lblName.Size = new System.Drawing.Size(232, 24);
		this.lblName.TabIndex = 0;
		this.lblName.Text = "User name (Nick)";
		//
		//lblAddress
		//
		this.lblAddress.Location = new System.Drawing.Point(16, 80);
		this.lblAddress.Name = "lblAddress";
		this.lblAddress.Size = new System.Drawing.Size(232, 24);
		this.lblAddress.TabIndex = 1;
		this.lblAddress.Text = "Computer name or network address";
		//
		//txtName
		//
		this.txtName.Location = new System.Drawing.Point(16, 40);
		this.txtName.Name = "txtName";
		this.txtName.Size = new System.Drawing.Size(328, 22);
		this.txtName.TabIndex = 0;
		this.txtName.Text = "";
		//
		//txtAddress
		//
		this.txtAddress.Location = new System.Drawing.Point(16, 104);
		this.txtAddress.Name = "txtAddress";
		this.txtAddress.Size = new System.Drawing.Size(328, 22);
		this.txtAddress.TabIndex = 1;
		this.txtAddress.Text = "";
		//
		//btnOK
		//
		this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
		this.btnOK.Location = new System.Drawing.Point(192, 144);
		this.btnOK.Name = "btnOK";
		this.btnOK.Size = new System.Drawing.Size(72, 32);
		this.btnOK.TabIndex = 2;
		this.btnOK.Text = "OK";
		this.btnOK.Click += new EventHandler(btnOK_Click);
		//
		//btnCancel
		//
		this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		this.btnCancel.Location = new System.Drawing.Point(272, 144);
		this.btnCancel.Name = "btnCancel";
		this.btnCancel.Size = new System.Drawing.Size(72, 32);
		this.btnCancel.TabIndex = 3;
		this.btnCancel.Text = "Cancel";
		//
		//ErrorProvider1
		//
		this.ErrorProvider1.DataMember = null;
		//
		//AddUser
		//
		this.AcceptButton = this.btnOK;
		this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
		this.CancelButton = this.btnCancel;
		this.ClientSize = new System.Drawing.Size(360, 192);
		this.Controls.AddRange(new System.Windows.Forms.Control[] {this.btnCancel, this.btnOK, this.txtAddress, this.txtName, this.lblAddress, this.lblName});
		this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
		this.MaximizeBox = false;
		this.MinimizeBox = false;
		this.Name = "AddUser";
		this.Text = "Add new user";
		this.ResumeLayout(false);

	}

	#endregion

	private void btnOK_Click(object sender, System.EventArgs e)
	{
		if (txtName.Text == "" || txtAddress.Text == "")
		{
			this.DialogResult = DialogResult.Cancel;
			MessageBox.Show("You didn't fill out all the fields. No user will be added.", "No text entered", MessageBoxButtons.OK, MessageBoxIcon.Information);
		}
	}

}
